import requests


class emp_api():
    @classmethod
    def add_emp(cls, header, json_data):
        url = "http://ihrm-test.itheima.net/api/sys/user"
        resp = requests.post(url=url, headers=header, json=json_data)
        return resp
    @classmethod
    def query_emp(cls, user_id, header):
        url = "http://ihrm-test.itheima.net/api/sys/user/{}".format(user_id)
        resp = requests.get(url=url, headers=header)
        return resp

    @classmethod
    def modify_emp(cls, user_id, header,json_data):
        url = "http://ihrm-test.itheima.net/api/sys/user/{}".format(user_id)
        resp = requests.get(url=url, headers=header,data=json_data)
        return resp

    @classmethod
    def del_emp(cls, user_id,header):
        url = "http://ihrm-test.itheima.net/api/sys/user/{}".format(user_id)
        resp = requests.delete(url=url,headers=header)
        return resp
